<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@ include file="/web/header.jsp"%>
<title>Insert title here</title>
</head>
<fieldset class="layui-elem-field" style="margin: 40px; padding: 40px;">
	<legend>用户注册：</legend>
	<form class="layui-form layui-form-pane" method="post">
		<div class="layui-form-item">
			<label class="layui-form-label">编号：</label>
			<div class="layui-input-inline">
				<input type="text" name="code" class="layui-input" lay-verify="required" placeholder="请输入编号" style="width: 15rem;">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">部门名称：</label>
			<div class="layui-input-inline">
				<input type="text" name="name" required class="layui-input" lay-verify="required" placeholder="请输入部门名称" style="width: 15rem;">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">电话号码：</label>
			<div class="layui-input-inline">
				<input type="text" name="tel" class="layui-input" lay-verify="required" placeholder="请输入电话号码" style="width: 15rem;">
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-input-inline">
				<input value="确定" type="button" class="layui-btn" lay-submit lay-filter="add" />
				<input value="重置" type="reset" class="layui-btn layui-btn-primary" />
			</div>
		</div>
		<input type="hidden" name="action" value="add" />
	</form>
</fieldset>
</body>
<script type="text/javascript">
	formSubmit('/DepartServlet', 'submit(add)', 'text', function(data) {
		if (data == 1) {
			layer.msg("注册成功", closeThis)
		} else {
			layer.msg("编号重复")
		}
	});
</script>

</html>
